﻿<UserControl x:Class="KineticListViewTest.SimpleTest"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:KineticListView="clr-namespace:KineticListView;assembly=KineticListView" xmlns:KineticListViewTest="clr-namespace:KineticListViewTest" mc:Ignorable="d" >
    <UserControl.Resources>
        <KineticListViewTest:ListOfElementViewModel x:Key="vm" />
        <DataTemplate x:Key="DataTemplate1" >
            <Border BorderThickness="5" Width="197" Height="197" BorderBrush="Red">
                <StackPanel>
                    <TextBlock TextWrapping="Wrap"><Run Text="Stringa che è abbastanza lunga0"/></TextBlock>
                    <TextBlock TextWrapping="Wrap" Text="{Binding IValue}" FontFamily="Segoe WP Black" FontSize="64" Foreground="Red" RenderTransformOrigin="0.5,0.5" TextAlignment="Center">
        				<TextBlock.RenderTransform>
        					<TransformGroup>
        						<ScaleTransform/>
        						<SkewTransform AngleX="20"/>
        						<RotateTransform/>
        						<TranslateTransform/>
        					</TransformGroup>
        				</TextBlock.RenderTransform>
                    </TextBlock>
                    <Button Content="ClickMe" Click="Button_Click" />
                </StackPanel>
            </Border>
        </DataTemplate>
    </UserControl.Resources>
    <StackPanel d:DataContext="{StaticResource ResourceKey=vm}">
        <StackPanel Orientation="Horizontal" >
            <KineticListView:KineticListView x:Name="listView1" ItemsSource="{Binding Path=DataToShow}"
                  Width="200"
                  Height="200" HypeEnabled="true"
                  ItemTemplate="{DynamicResource DataTemplate1}" 
                  BorderThickness="0"
                                 Direction="Horizontal">

            </KineticListView:KineticListView>


            <KineticListView:KineticListView x:Name="listView2" ItemsSource="{Binding Path=DataToShow}"
                  Width="600"
                  ItemTemplate="{DynamicResource DataTemplate1}" 
                  BorderThickness="0"
                  SelectedObject="{Binding SelObj, Mode=TwoWay}"
                  HideSelection="false"
                  Direction="Horizontal">

            </KineticListView:KineticListView>
            <Grid Width="200" Background="White">
            	<Grid.ColumnDefinitions>
            		<ColumnDefinition Width="0.725*"/>
            		<ColumnDefinition Width="0.275*"/>
            	</Grid.ColumnDefinitions>
            	<Grid.RowDefinitions>
            		<RowDefinition Height="23.5"/>
            		<RowDefinition Height="24"/>
            		<RowDefinition Height="26.5"/>
            		<RowDefinition Height="26"/>
                    <RowDefinition Height="26"/>
            	</Grid.RowDefinitions>
               <TextBox Text="{Binding ElementName=listView2, Path=CurrentFirstElementIndex}" Grid.Column="1" />
               <Label Content="First element" Margin="0" d:LayoutOverrides="Width, Height"/>
               <Label Content="Animation Speed" Margin="0" d:LayoutOverrides="Width, Height" Grid.Row="1"/>
               <TextBox Text="{Binding AnimationSpeed, ElementName=listView2}" Grid.Column="1" Grid.Row="1" />
               <Label Content="Animation Enabled" Margin="0" Grid.Row="2" d:LayoutOverrides="Width, Height"/>
               <CheckBox Content="" Grid.Column="1" Margin="0" Grid.Row="2" d:LayoutOverrides="Width, Height" IsChecked="{Binding AnimationEnabled, ElementName=listView2}"/>

                <TextBox Text="{Binding ElementName=listView2, Path=SelectedObject.IValue}" Grid.Column="1" Grid.Row="3"/>
                <Label Content="SelectedObject" Margin="0" d:LayoutOverrides="Width, Height" Grid.Row="3" />

                <TextBox Text="{Binding SelObj.IValue}" Grid.Column="1" Grid.Row="4"/>
                <Label Content="Selected Value" Margin="0" d:LayoutOverrides="Width, Height" Grid.Row="4" />
            </Grid>
            
        </StackPanel>



    </StackPanel>
</UserControl>
